package ldh.im.fxgui.demo;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

public class WebViewRtcDemo extends Application {


    @Override
    public void start(Stage primaryStage) throws Exception {
//        System.setProperty("jfx.webview.enablewebrtc", "true");
        WebView webView = new WebView();
        WebEngine webEngine = webView.getEngine();

        webEngine.setCreatePopupHandler(popup->{
            System.out.println("require permission");
            return null;
        });

        webEngine.load("http://localhost:8900");
        primaryStage.setScene(new Scene(webView, 800, 600));
        primaryStage.show();
    }
}
